<template>
  <div>
    <div v-for="item in ItemList" :key="item.path">
      <el-submenu
        :index="item.path"
        v-if="item.children && item.children.length > 0">
        <template slot="title">
          <i class="fontFamily vuemianxingshezhi"></i>
          <span  slot="title" :class="isCollapse && item.path.indexOf('/')===item.path.lastIndexOf('/') ? 'bbc':''">{{ item.title }}</span>
        </template>
        <Navbar :ItemList="item.children" />
      </el-submenu>

      <el-menu-item :index="item.path" v-else>
        <i class="fontFamily vuemianxingzhuye"></i>
        <span slot="title">{{ item.title }}</span>
      </el-menu-item> 
    </div>
  </div>
</template>

<script>
export default {
  name: "Navbar",
  props: {
    ItemList: {
      type: Array,
      require: true,
    },
    isCollapse:{
      default:true
    }
  },
};
</script>

<style>
.el-menu-vertical .el-submenu__title .bbc{
  display: none;
}
.el-menu-vertical .el-submenu__title .bbc + .el-submenu__icon-arrow{
  display: none;
}
</style>

